<div id="content" class="testd">
<h1><?php if($title){ echo $title; } ?></h1><br>
<a href="<?php echo site_url('qbank/add_new');?>">Add new</a>
<?php 
if($resultstatus){ echo "<div id='result'>".$resultstatus."</div>"; }
 ?>
 <div class="wite">
<table id="detail">
<tr><td ><form method="post" action="<?php echo site_url('qbank');?>">
<select name="search_type">
<option value="qbank.qid">ID</option>
<option value="qbank.question">Question</option>
<option value="question_category.category_name">Category</option>
<option value="difficult_level.level_name">Level</option>
</select>
<input type="text" name="search" value=""> 
<input type="submit" value="Search"></form></td></tr>
</table>

<table id="data_list">
<tr><th>Id</th><th>Question</th><th>Category</th><th>Level</th><th>Action</th></tr>
<?php
if($result==false){
?>
<tr>
<td colspan="5">
No record found!
</td>
</tr>
<?php

}else{
foreach($result as $row){
?>
<tr>
<td><?php echo $row->qid;?></td><td><?php echo $row->question;?></td><td><?php echo $row->category_name;?></td><td><?php echo $row->level_name;?></td><td><a href="javascript: if(confirm('Bạn có chắc là muốn xóa không? question?')){ window.location='<?php echo site_url('qbank/remove_question/'.$row->qid );?>'; }"><img src="<?php echo base_url();?>images/cross.png" title="Remove"></a>  <a href="<?php echo site_url('qbank/edit_question/'.$row->qid );?>"><img src="<?php echo base_url();?>images/edit.png" title="Edit"></a></td>
</tr>
<?php
}
}
?>


</table>
<br>
<a href="<?php echo site_url('qbank/add_new');?>"><img src="<?php echo base_url();?>images/plus.png" title="Add new"></a>
&nbsp;&nbsp;
<?php
if(($limit-($this->config->item('number_of_rows')))>=0){ $back=$limit-($this->config->item('number_of_rows')); }else{ $back='0'; } ?>

<a href="<?php echo site_url('qbank/index/'.$back);?>">Back</a>
&nbsp;&nbsp;
<?php
 $next=$limit+($this->config->item('number_of_rows'));  ?>

<a href="<?php echo site_url('qbank/index/'.$next);?>">Next</a>

<br>
<table id="detail">
<tr><td>	<?php echo form_open('qbank/import',array('enctype'=>'multipart/form-data')); ?>
 <select name="cid">
 <option value="0">Select Category</option>
<?php foreach($category as $value){ ?>
<option value="<?php echo $value->cid; ?>"><?php echo $value->category_name; ?></option>
<?php } ?></select>
 
 <select name="did">
 <option value="0">Select level</option>
<?php foreach($difficult_level as $value){ ?>
<option value="<?php echo $value->did; ?>"><?php echo $value->level_name; ?></option>
<?php } ?></select> 
Upload Excel file ( .xls only )
	<input type="hidden" name="size" value="3500000">
	<input type="file" name="xlsfile" >
	<input type="submit" value="Import"></form></td></tr>
</table>
<a href="<?php echo base_url();?>xls/sample.xls" target="new">Click here</a> to download sample file to know file format
</div></div>
